<admintpl file="header" />
</head>
<body>
    <div class="wrap">
        <ul class="nav nav-tabs">
            <li><a href="{:U('Log/index')}">日志列表</a></li>
            <li class="active"><a href="{:U('Log/add')}">新增日志</a></li>
        </ul>
       <form method="post" class="form-horizontal " action="{:U('Log/add_post')}">
            <div class="form-group">
                <label class="col-md-2 control-label"><span class="required" aria-required="true"> * </span>日志主题</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" name="title" placeholder="请输入日志主题" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label"><span class="required" aria-required="true"> * </span>日志类型</label>
                <div class="col-md-2">
                    <select name="type" class="form-control">
							<option value="日常工作">日常工作</option>
							<option value="会议">会议</option>
							<option value="培训">培训</option>
							<option value="接待客户">接待客户</option>
							<option value="出差">出差</option>
							<option value="内部讨论">内部讨论</option>
							<option value="其它">其它</option>
                    </select>
                </div>
            </div>
			<div class="form-group">
                <label class="col-md-2 control-label">开始时间</label>
                <div class="col-md-2">
                    <input type="text" class="form-control WdatePicker startDate"  id = "startDate" name="starttime" placeholder="请输入开始时间" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm',maxDate:'#F{ $dp.$D(\'endDate\')}'})" readonly>
                </div>
            </div>
			<div class="form-group">
                <label class="col-md-2 control-label">结束时间</label>
                <div class="col-md-2">
                    <input type="text" class="form-control WdatePicker endDate" id = "endDate" name="endtime" placeholder="请输入结束时间" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm',minDate:'#F{ $dp.$D(\'startDate\')}'})" readonly>
                </div>
            </div>
			<div class="form-group">
                <label class="col-md-2 control-label">地址</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" name="address" placeholder="请输入地址">
                </div>
            </div>
			<div class="form-group">
                <label class="col-md-2 control-label"><span class="required" aria-required="true"> * </span>日志内容</label>
                <div class="col-md-4">
                    <textarea class="form-control" name="content" style="height:8em;"></textarea>
                </div>
            </div>
            <div class="form-actions col-md-10 col-md-offset-2">
                <button type="submit" class="btn btn-primary js-ajax-submit" onclick="return checkForm();">{:L('ADD')}</button>
                <a class="btn btn-default" href="javascript:history.back(-1);">{:L('BACK')}</a>
            </div>
        </form>
    </div>
    <script src="__PUBLIC__/js/common.js"></script>
	<script language="javascript" type="text/javascript" src="__PUBLIC__/js/My97DatePicker/WdatePicker.js"></script>
	<script>
		function checkForm(){
			if(!$('input[name="title"]').val()){
				alert('日志主题不能为空');
				$('input[name="title"]').focus();
				return false;
			}
			if(!$('textarea[name="content"]').val()){
				alert('日志内容不能为空');
				$('textarea[name="content"]').focus();
				return false;
			}
			return true;
		}
	</script>
</body>
</html>